#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QDesktopWidget>
#include <QPlastiqueStyle>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    setGeometry(QApplication::desktop()->rect());
    QPlastiqueStyle yigStyle;

    QLinearGradient gradient(0, 0, 0, 255);
    gradient.setColorAt(0.0, QColor(220,220,220,255));
    gradient.setColorAt(0.005, QColor(90,90,90,255));
    gradient.setColorAt(0.15, QColor(40,40,41,255));
    gradient.setColorAt(0.4, QColor(0,0,0));
    gradient.setInterpolationMode(QGradient::ColorInterpolation);
    QBrush backgroundBrush(gradient);
    backgroundBrush.setStyle(Qt::LinearGradientPattern);

    QPalette windowPalette = palette();
    windowPalette.setBrush(QPalette::Window, backgroundBrush);
    setPalette(windowPalette);
    setStyle(&yigStyle);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::resizeEvent(QResizeEvent *)
{
    emit resized();
}
